import router from 'vue-router'
import Vue from 'vue'
import Home from '../views/Home.vue'
import Main from '../views/Main.vue'

Vue.use(router)

export default new router({
	routes : [{
			path: '/',
			name: '',
			component: Main,
			children: [{
				path: '/',
				name: 'Home',
				component: Home
			},
			{
				path: '/article/list',
				name: 'ArticleList',
				component: ()=>import('../views/ArticleList.vue')
			},
			{
				path: '/article/:id',
				name: 'ShowArticle',
				component: ()=>import('../views/ShowArticle.vue'),
				props:true
			},
			{
				path: '/contest/:id',
				name: 'ShowContest',
				component: ()=>import('../views/ShowContest.vue'),
				props:true
			},
			{
				path: '/achievement/list',
				name: 'AchievementList',
				component: ()=>import('../views/AchievementList.vue')
			},
			
			{
				path: '/achievement/:id',
				name: 'ShowAchievement',
				component: ()=>import('../views/ShowAchievement.vue'),
				props:true
			},
			{
				path: '/file/list',
				name: 'FileList',
				component: ()=>import('../views/FileList.vue')
			},
			]
		},
		{
			path: '/about',
			name: 'About',
			// route level code-splitting
			// this generates a separate chunk (about.[hash].js) for this route
			// which is lazy-loaded when the route is visited.
			component: () => import( /* webpackChunkName: "about" */ '../views/About.vue')
		}
	]
})
